package com.qx.web_maven.controller;

import com.qx.web_maven.dao.UsersDao;

@WebServlet( name = "UsersServlet", urlPATTERNS = "/UseresServlet")
public class UsersServlet {

)

    public class HelloServlet  extends  Httpservlet{
        protected  void  doPost )HttpservletRequest request, HttpServletResponse response) throws SerletException{


        }
        protected  void  doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,{
            doPost(requset,response);
            UsersDao dao = new UsersDao();
            List<Users> list = dao.getList();
            try{
                list = dao.getList();

            }catch (Exception e){
                e.printStackTrace();
            }
            System.out.println(list.size());
            //将数据保存到页面做显示
            request.setAttribute(s:"list",list);
            //页面转发
            request.getRequestDispatcher(s:"list.jsp").forward(request,response);

        }
    }
}
